<?php

/**
 * Challenge Cup mininav widget file,
 * @author Luke Barratt 
 * @copyright Copyright (C) 2008 by Luke Barratt
 * @license http://www.gnu.org/copyleft/gpl.html
 */
 
defined('CC_VALID') or 
die('Direct Access to this location is not allowed.'); 

$CC_ARROW = "<span class=\"arrow\"> > </span>";
$CC_GAME_ID = $_GET['game_id'];
$CC_TEAM_ID = $_GET['team_id'];
$CC_MODULE = $_GET['mod'];
$CC_MININAV_QUERY = mysql_query("SELECT * FROM cc_game WHERE game_id = '{$CC_GAME_ID}'");
$CC_MININAV_ARRAY = mysql_fetch_array($CC_MININAV_QUERY);
$CC_MININAV_TEAM_QUERY = mysql_query("SELECT * FROM cc_teams WHERE team_id = '{$CC_TEAM_ID}'");
$CC_MININAV_TEAM_ARRAY = mysql_fetch_array($CC_MININAV_TEAM_QUERY);

echo "<a href=\"index.php\">"; 
CC_TITLE(); 
echo"</a>"; 

if ($CC_GAME_ID == "") 
{
	echo $CC_ARROW . $CC_MODULE;
}

if (isset($CC_GAME_ID) && $CC_GAME_ID != "" && !isset($CC_TEAM_ID)) 
{
	echo $CC_ARROW ."<a href=\"index.php?mod=portal&game_id={$CC_GAME_ID}\">". $CC_MININAV_ARRAY['game_name'] ."</a>". $CC_ARROW . $CC_MODULE;
}

if (isset($CC_GAME_ID) && $CC_GAME_ID != "" && $CC_TEAM_ID != "") 
{
	echo $CC_ARROW ."<a href=\"index.php?mod=portal&game_id={$CC_GAME_ID}\">". $CC_MININAV_ARRAY['game_name'] ."</a>". $CC_ARROW . "<a href=\"index.php?mod=". $CC_MODULE ."&game_id={$CC_GAME_ID}\">". $CC_MODULE ."</a>". $CC_ARROW . $CC_MININAV_TEAM_ARRAY['team_name'];
}

?>